﻿<%@ Control Language="C#" EnableViewState="true" %>
<%@ Register Assembly="Antu.WebControls" Namespace="Antu.WebControls" TagPrefix="CBW" %>
<script type="text/javascript">
    function turnDiv() {
        document.getElementById('divUpload').style.display = "none";
        var da = document.getElementsByTagName("a");
        for (var i = 0; i < da.length; i++) {
            if (da[i].innerHTML == "删除") {
                da[i].innerHTML = " ";
            }
        }
        var td = document.getElementsByTagName("td");
        for (var k = 0; k < td.length; k++) {
            td[k].onclick = "";
        }
    }
</script>
<link href="../../themes/default/Script/fileup/uploadify.css" rel="stylesheet" type="text/css" />

<script src="../../themes/default/Script/fileup/jquery142min.js" type="text/javascript"></script>

<script src="../../themes/default/Script/fileup/juploadifyv214min.js" type="text/javascript"></script>

<script src="../../themes/default/Script/fileup/swfobject.js" type="text/javascript"></script>
<script type="text/javascript" language="javascript">
    window.onload = function aa() {
        var pid = '<%=Request["cid"] %>';
            $("#File1").uploadify(
                        {
                            'uploader': '../../themes/default/Script/fileup/uploadify.swf?var=' + (new Date()).getTime(),
                            'fileExt': '*',
                            'fileDesc': '请选择上传文件',
                            'script': 'Handler.ashx?temp=' + pid,
                            'buttonText': '.',
                            'buttonImg': '../../themes/default/Script/fileup/select.png',
                            'hideButton': 'false',
                            'cancelImg': '../../themes/default/Script/fileup/cancel.png',
                            'folder': 'Upload',
                            'queueID': 'fileQueue',
                            'height': 32,
                            'width': 118,
                            'wmode': 'transparent',
                            'auto': false,
                            'multi': true
                        });
        };
        function getChuan() {
            $('#File1').uploadifyUpload();
            setTimeout("showTree()", 1500);
        }
        function showTree() {
            location.href = location.href;
        }
</script>
<table width="100%" border="0" cellpadding="0" cellspacing="0" style="background-image: url(<%= Antu.Core.Components.SiteSettings.DefaultSiteSettings.DefaultThemeFolderMapPath %>images/menuthb.png); margin-top: 1px">
    <tr>
        <td valign="middle" height="30">
            <font style="font-size: 14px; font-weight: bold; color: #3E7CC3; float: left; color: black">
                            &nbsp; 附件上传  </font>
        </td>
    </tr>
</table>
<div id="divUpload" style="margin-top: 10px; text-align: center;">
    <table cellpadding="0" cellspacing="0" align="center" class="window_tab_list" style="width: 98%; margin: 20px 0 10px 0; line-height: 35px; text-align: center;">
        <tr style="height: 30px; display: none;">
            <td>上传附件名称：</td>
            <td style="width: 80%" align="left">&nbsp;&nbsp;
                        <asp:TextBox ID="filename" runat="server" />(如不填则选择上传的文件名为默认文件名)
            </td>
        </tr>
        <tr style="height: 30px;">
            <td>上传类型：
            </td>
            <td style="text-align: left;">&nbsp;&nbsp;
                        <asp:DropDownList ID="DropDownList1" runat="server">
                        </asp:DropDownList>
                &nbsp;&nbsp;&nbsp;&nbsp;<asp:Button ID="Button1" runat="server" Text="关 闭" />
                <span style="color: Red; font-size: 12px;">（提示：附件大小必须小于5M！）</span>
            </td>
        </tr>
        <tr style="height: 30px; display: none;">
            <td>附件上传：</td>
            <td align="left">&nbsp;&nbsp;
                        <asp:FileUpload ID="picFile" runat="server" BorderStyle="Solid" BorderWidth="1px" BorderColor="#CEE3F7" BackColor="#FFFFFF" />
            </td>
        </tr>
        <tr style="height: 30px;">
            <td>批量上传：</td>
            <td>
                <div style="margin-left: 20px; margin-top: 20px; float: left;">
                    <input type="file" name="File1" id="File1" />&nbsp;&nbsp;</div>
                <div style="margin-left: 20px; margin-top: 20px; float: left;" onclick="getChuan()" style="cursor: pointer;">
                    <img src="../../themes/default/Script/fileup/upload.png" alt="" style="border: 0px" />(支持jpg,gif,jpeg,bmp,doc,docx,xls格式) </div>
            </td>
        </tr>
        <tr>
            <td></td>
            <td>
                <div style="height: 250px; width: 484px; overflow: auto;">
                    <div id="fileQueue">
                    </div>
                </div>
            </td>
        </tr>

        <tr style="height: 30px;">
            <td style="text-align: center; height: 30px" colspan="2">
                <asp:Button ID="upfile" Style="display: none;" runat="server" Text="上 传" />&nbsp;
                       
                 
            </td>
        </tr>
    </table>
</div>
<div style="text-align: center; width: 100%;">
    <table style="width: 100%;">
        <tr>
            <td></td>
        </tr>
        <tr>
            <td style="height: 21px" align="center">
                <CBW:CustomGridView ID="CustomGridView1" runat="server" AllowPaging="True" SkinID="List" PageSize="10"
                    CustomSortExpression="" AutoGenerateColumns="false" ShowCmpAndCancel="False"
                    ShowHideColModel="None" Width="765px" CssClass="window_tab_list" CustomGridViewStyle="text-align: center;"
                    AllowOnMouseOverEvent="True" AutoGenerateDeleteConfirm="True" CustomGridViewClass="window_tab_list_fst">
                    <PagerSettings Visible="False" />
                    <Columns>
                        <asp:TemplateField HeaderText="查看" ItemStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                                <a href='../ZSManage/showfile.aspx?id=<%#Eval("ID") %>' target="_blank">附件</a>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="name" HeaderText="资源名称" ItemStyle-HorizontalAlign="Center"></asp:BoundField>
                        <asp:BoundField DataField="SUFFIX" HeaderText="资源类型" ItemStyle-HorizontalAlign="Center"></asp:BoundField>
                        <asp:CommandField ShowDeleteButton="True" HeaderText="删除" ItemStyle-HorizontalAlign="Center" />
                    </Columns>
                </CBW:CustomGridView>
            </td>
        </tr>
    </table>
</div>
